# Contributor: Galen Abell <galen@galenabell.com>
# Maintainer: Galen Abell <galen@galenabell.com>
pkgname=profanity
pkgver=0.14.0
pkgrel=1
pkgdesc="Ncurses based XMPP client"
url="https://github.com/profanity-im/profanity"
arch="all"
license="GPL-3.0-or-later"
makedepends="
	autoconf
	autoconf-archive
	automake
	libtool
	pkgconf
	libmesode-dev
	ncurses-dev
	glib-dev
	curl-dev
	readline-dev
	libotr-dev
	libsignal-protocol-c-dev
	libgcrypt-dev
	libstrophe-dev
	cmocka-dev
	sqlite-dev
"
subpackages="$pkgname-doc"
source="$pkgname-$pkgver.tar.gz::https://github.com/profanity-im/profanity/archive/$pkgver.tar.gz
	"

prepare() {
	default_prepare
	./bootstrap.sh
}

build() {
	# GPG is "suboptimal" for chat, since it doesn't provide forward secrecy, deniability, ...
	# Its usage/support is currently discouraged in XMPP.
	# Users are encouraged to use OTR, or even better, OMEMO.
	./configure \
		--disable-plugins \
		--build=$CBUILD \
		--host=$CHOST \
		--prefix=/usr \
		--sysconfdir=/etc \
		--mandir=/usr/share/man \
		--localstatedir=/var \
		--enable-pgp=no
	make
}

check() {
	LANG=en_US.UTF-8 make check
}

package() {
	make DESTDIR="$pkgdir" install
}

sha512sums="
a1715e755f879e386fd1a9bf00ad241930b4010c38dc05e5bd6ba81ca0f2b8d3e6a564f9a7f839a6a2112513d7fc664d2f16ec3b844de7b7cf83cdd26d4f076d  profanity-0.14.0.tar.gz
"
